<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <div id="root">

     </div>
</body>
<!-- CDN引入18 -->
<script src="https://unpkg.com/react@18.2.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js"></script>
<script>
    console.log(React)
    let h1 = React.createElement("h1",null,"Reactv18渲染dom");
    console.log(h1)
    console.log(ReactDOM)
    // 创建渲染容器 createRoot
    let root = ReactDOM.createRoot(document.getElementById("root"));
    console.log(root)
    // 将虚拟dom转化为真实dom并渲染到容器中
    root.render(h1)
</script>
</html>